package pendotech.com.pendootg.mvc;

import java.util.Random;

import pendotech.com.pendootg.bean.Account;
import pendotech.com.pendootg.callback.MCallback;

/**
 * Created by dh on 2022/1/10.
 */

public class MvcModel {
    public void getAccountData(String accountName, MCallback mCallback) {
        Random random = new Random();
        boolean isSuccess = random.nextBoolean();
        if (isSuccess) {
            Account account = new Account();
            account.setName(accountName);
            account.setAge(20);
            mCallback.onSuccess(account);
        } else {
            mCallback.onFail();
        }

    }
}
